/**
 * @author Nathan Judkins
 * @version 1
 * 
 * This class is for testing the methods of the ConferenceManager 
 * class
 */

package Test;

import static org.junit.Assert.*;

import java.util.ArrayList;
import java.util.Collections;
import java.util.Date;

import org.junit.Test;

import Model.User;
import Model.ConferenceManager;
import Model.Conference;

public class TestConferenceManager
{
  
  private static final User PAUL = new User("Paul Shultz", "PaulS",
      "P@fake.com");
  private static final User WILLIAM = new User("William Kim", "WilliamK",
      "W@fake.com");
  private static final User IRVING = new User("Irving Estrera", "IrvingE",
      "I@fake.com");
  private static final User NATHAN = new User("Nathan Judkins", "NathanJ",
      "N@fake.com");
  

  public void testAddConference(ConferenceManager manager)
  { 
    manager.addConference("Smart Software Development", new Date(1990, 06, 21));
    
    ArrayList<Conference> someConferences = new ArrayList<Conference>();
    
    someConferences = manager.getConferences();
    
    if (someConferences.isEmpty())
      fail("A conference was not created and added properly in ConferenceManager");
  }
  
  @Test
  public void testLogIn()
  {
    ConferenceManager manager = new ConferenceManager();
    
    manager.addUser(NATHAN);
    manager.addUser(IRVING);
    manager.addUser(WILLIAM);
    manager.addUser(PAUL);
    
    if (manager.getUsers().isEmpty())
      fail("We failed to properly add Users");
      
    if (!manager.login("NathanJ"))
        fail("The first test of manager failed");
    
    if (manager.login("rawrg"))
        fail("Failed at catching a log in with no known user");
    
    
    
    testAddConference(manager);
    
    
  }

}
